<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <h1>window</h1>
    <hr>

    <button onclick="run()">点我一下</button>

    <hr>

    <button onclick="window.open()">open(空白页)</button>

    <button onclick="window.open('http://www.baidu.com')">open(去百度)</button>


    <button onclick="window.open('http://www.baidu.com','shasha')">open(名字)</button>

    <button onclick="window.open('http://www.baidu.com','shasha123123')">open(name)</button>

    <button onclick="window.open('http://www.baidu.com','')">open(name)</button>



    <!-- 打开窗口的大小 -->

    <button onclick="window.open('http://www.baidu.com','','width=300,height=600')">open(size)</button>

    <button onclick="window.print()">打印</button>
</body>
<script>
    window.name = 'shasha';


    //自定义对象
    var obj = {name:'磊哥'};
    console.log(obj);
    console.log(window.obj);

    //变量
    
    var a = 100;
    console.log(a);
    console.log(window.a);

    //自定义函数
    function demo(){
        console.log('呆头呆脑..');
    }

    demo();
    window.demo();




    function run(){
        do {
            //输入弹框
            
            var name = prompt('您贵姓?');

            //确认框
            
            var content = confirm('您输入的是:['+name+']\n'+ '是否确认输入');
        } while (!content);
        alert('hi,小'+name + name);
    }
</script>
</html>